//
//  WAServicesController.m
//  WalkiOS
//
//  Created by luqiuan on 2019/10/31.
//  Copyright © 2019 Chenmuzhou. All rights reserved.
//

#import "WAServicesController.h"


@interface WAServicesController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation WAServicesController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    NSString *WAimageUrl = [NSString stringWithFormat:@"%@/code.jpg",kWNBaseURLString];
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:@"http://baby921.top/service_code.jpg"]];
    
}

- (IBAction)buttonAction:(id)sender {
    
    if (!self.imageView.image) {
        return;
    }
    UIImageWriteToSavedPhotosAlbum(self.imageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}

//保存图片
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
    NSString * msg = nil;
    if (error == nil) {
        msg = @"保存成功";
    }else{
        msg = @"保存失败";
    }
    [WNTool show:msg];
}

- (IBAction)backAction:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
@end
